Append To CSV
AutomatR.DefaultActivities.CSV.AppendToCSV
The "Append To CSV" activity in AutomatR is part of the CSV activities package, allowing users to append data from a DataTable to an existing CSV file. This activity is valuable for scenarios where you need to continuously add data to an existing CSV file without overwriting its content.
Properties
Name | Description |
---|---|
Input | |
Data | Specifies the DataTable variable reference containing the data to be appended to the CSV file. |
Delimiter | Specifies the delimiter used in the CSV file. Choose from common options like Tab, Comma(,), Semicolon(;), Caret(^), or Pipe(I). Char variables containing the desired delimiter. |
File Path | Specifies the full path of the CSV file on the local drive, including the filename (e.g., "C:\excelActivities\workbook.csv"). String variables containing the file path. |
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variables containing the desired display name. |
Optional | |
Delay | Specifies the amount of time (in seconds) to wait before executing the "Append To CSV" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1. |
Output | |
Result | Outputs the result of the "Append To CSV" operation, indicating whether the operation was successful (True) or encountered errors (False). Boolean variables to store the operation result. |
How to use:
- Drag and drop the "Append To CSV" activity onto the workflow.
- Configure the properties by specifying the DataTable variable containing the data, the delimiter used in the CSV file, and the full path of the CSV file on the local drive.
- Optionally, configure the delay.
- Execute the workflow to append the specified data to the existing CSV file.
Example: Consider an example where the "Append To CSV" activity is used to add new data to an existing CSV file:
Append To CSV:
Data: dataTableVariable
Delimiter: ','
File Path: "C:\example\existing_data.csv"
Result: isAppendSuccessful
In this example, the activity appends the data from the "dataTableVariable" to the CSV file located at "C:\example\existing_data.csv". The result of the operation (success or failure) is stored in the Boolean variable "isAppendSuccessful" for further handling in the workflow.
Note:
- Ensure that the CSV file exists before using this activity.
- The activity supports various delimiters to accommodate different CSV file formats.